#ifndef _DEFINE_H_
#define _DEFINE_H_

#include "include.h"

#ifdef		WIN32

#define		MUTEX_LOCK					CRITICAL_SECTION
#define		_INIT_LOCK( _plock_ )		::InitializeCriticalSection( (_plock_) )
#define		_LOCK( _plock_ )			::EnterCriticalSection( (_plock_) )
#define		_UNLOCK( _plock_ )			::LeaveCriticalSection( (_plock_) )
#define		_DEL_LOCK( _plock_ )		::DeleteCriticalSection( (_plock_) )

#else

#define		MUTEX_LOCK					pthread_mutex_t
#define		_INIT_LOCK( _plock_ )		pthread_mutex_init( (_plock_), NULL )
#define		_LOCK( _plock_ )			pthread_mutex_lock( (_plock_) )
#define		_UNLOCK( _plock_ )			pthread_mutex_unlock( (_plock_) )
#define		_DEL_LOCK( _plock_ )		pthread_mutex_destroy( (_plock_) )

#endif

#define		IF_GOTO( _flag_, _lab_ )	 if ( _flag_ )	goto _lab_

#endif // _DEFINE_H_
